﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using Sinacor.Infra.Service.ExceptionHandling;
//using Sinacor.Infra.Service.Security.Authorization;
using Sinacor.Infra.Common.Validation;
//using Sinacor.Infra.Service.Security.Session;
using Sinacor.Infra.Core.Licensing;
using System.Reflection;

namespace Sinacor.Infra.Service.Common
{
    public abstract class BaseCommunication : Sinacor.Infra.Common.BaseCommunication
    {
        /// <summary>
        /// Construtor da classe <see cref="BaseCommunication"/>
        /// </summary>
        /// <param name="session">Informação da sessão ativa</param>
        public BaseCommunication(string loginName, string password, int companyId)
            : base()
        {
            this.LoginName = loginName;
            this.Password = password;
            this.CompanyId = companyId;
        }

        public BaseCommunication(string loginName, string password, int companyId, int? sessionId, string tokenId, bool? sessionExpires)
            : this(loginName, password, companyId)
        {
            this.SessionId = sessionId;
            this.TokenId = tokenId;
            this.SessionExpires = sessionExpires;
        }

        public string LoginName { get; private set; }
        public string Password { get; private set; }
        public int CompanyId { get; private set; }
        public int? SessionId { get; private set; }
        public string TokenId { get; private set; }
        public bool? SessionExpires { get; private set; }
        
        protected override Exception CreateCommunicationException(Exception ex)
        {
            return ex;
        }        
    }
}
